﻿using System;
using System.Windows.Forms;
using Csla.Tools.Plantillas;
using DemoCSLA.Windows.Facturas;

namespace DemoCSLA.Windows
    {
    public partial class MainForm : _PlantillaPrincipal
        {

        private static MainForm m_instancia;
        internal static MainForm Instancia
        {
            get { return m_instancia; }
        }

        public MainForm()
            {
            InitializeComponent();
            m_instancia = this;
            }

        private void MainForm_Load(object sender, EventArgs e)
            {
                this.lblEstado.Text = String.Format( "Autenticado como {0}" ,
                    Environment.UserName);
            }

        private void clientesToolStripMenuItem_Click(object sender, EventArgs e)
            {
            using ( frmMntClientes f = new frmMntClientes() )
                {
                f.ShowDialog(this);
                }

            }

        private void toolSalir_Click(object sender, EventArgs e)
            {
            Application.Exit();
            }

        private void productosToolStripMenuItem_Click(object sender, EventArgs e)
            {
            using ( frmMntProducto f = new frmMntProducto() )
                {
                f.ShowDialog(this);
                }
            }

        private void facturasToolStripMenuItem_Click(object sender, EventArgs e)
            {
            using ( frmLstFacturas f = new frmLstFacturas() )
                {
                f.ShowDialog(this);
                }
            }
        }
    }
